﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewData["Title"] - 儿童照片管理系统</title>
    <!-- 引入Bootstrap样式 -->
    <link href="~/lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <!-- 导航栏 -->
    <header>
        <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
            <div class="container">
                <a class="navbar-brand" asp-page="Index">儿童照片管理</a>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="navbar-nav ms-auto">
                        @if (User.Identity?.IsAuthenticated == true)
                        {
                            <!-- 登录后显示用户名和注销按钮 -->
                            <li class="nav-item">
                                <span class="nav-link">欢迎，@User.Identity.Name</span>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" asp-page="/Account/Logout">注销</a>
                            </li>
                        }
                        else
                        {
                            <!-- 未登录显示登录/注册按钮 -->
                            <li class="nav-item">
                                <a class="nav-link" asp-page="/Account/Login">登录</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" asp-page="/Account/Register">注册</a>
                            </li>
                        }
                    </ul>
                </div>
            </div>
        </nav>
    </header>

    <!-- 主内容区 -->
    <main class="py-4">
        @RenderBody()
    </main>

    <!-- 页脚 -->
    <footer class="bg-light py-3 mt-5">
        <div class="container text-center">
            <span class="text-muted">© @DateTime.Now.Year 儿童照片管理系统</span>
        </div>
    </footer>

    <!-- 引入Bootstrap脚本 -->
    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>